package com.dragon.modules.yuegou.query.member;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.member.AppleidRefEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

/**
 * 苹果登录ID与会员关系表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2020-04-08 14:36:51
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class AppleidRefQuery extends AppleidRefEntity implements Query<AppleidRefEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "memberId")
	private Condition<String> memberIdCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "appleId")
	private Condition<String> appleIdCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public AppleidRefQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public AppleidRefQuery(AppleidRefEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public AppleidRefQuery(AppleidRefQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.memberIdCondition != null) {
			this.memberIdCondition = other.memberIdCondition.copy();
		}
		if(other.appleIdCondition != null) {
			this.appleIdCondition = other.appleIdCondition.copy();
		}
	}

	@Override
	public QueryWrapper<AppleidRefEntity> toQueryWrapper() {
		QueryWrapper<AppleidRefEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (memberIdCondition != null) {
			memberIdCondition.toWrapper(wrapper, COL_MEMBER_ID);
		}
		if (appleIdCondition != null) {
			appleIdCondition.toWrapper(wrapper, COL_APPLE_ID);
		}
		return wrapper;
	}

	
	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return memberIdCondition 查询条件
	 */
	public Condition<String> memberId() {
		this.memberIdCondition = new Condition<>();
		return this.memberIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return memberIdCondition 查询条件
	 */
	public Condition<String> getMemberIdCondition() {
		return memberIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param memberIdCondition 查询条件
	 */
	public void setMemberIdCondition(Condition<String> memberIdCondition) {
		this.memberIdCondition = memberIdCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return appleIdCondition 查询条件
	 */
	public Condition<String> appleId() {
		this.appleIdCondition = new Condition<>();
		return this.appleIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return appleIdCondition 查询条件
	 */
	public Condition<String> getAppleIdCondition() {
		return appleIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param appleIdCondition 查询条件
	 */
	public void setAppleIdCondition(Condition<String> appleIdCondition) {
		this.appleIdCondition = appleIdCondition;
	}

}
